<template>
  <div>
    <h1>Child1 --- {{num}}</h1>

    <button @click='addCount'>让父组件加1</button>
  </div>
</template>

<script>
export default {
  name: "Child1",
  data(){
    return {
      num :0
    }
  },
  methods:{
    addCount(){
      this.$parent.count++
    }
  }
};
</script>

<style>
</style>